package org.xdq.lamdba;



public class Test {

    static interface One{
        public void f();
    }

    @FunctionalInterface
    static interface Two{
        public int f();
    }

    @FunctionalInterface
    static interface Three{
        public int f(int a);
    }

    @FunctionalInterface
    static interface Four{
        public int f(int a,int b);
    }

    @FunctionalInterface
    static interface Five{
        public void f(String str);
    }

    public static void main(String[] args) {
        One one = ()->{
            System.out.println("One的实现！");
        };
        one.f();

        Two two = ()->123456;
        System.out.println(two.f());

        Three three = x->x*x;
        System.out.println(three.f(5));

        Four four = (x,y)->x+y;
        System.out.println(four.f(3,5));

        Five five = str ->{
            System.out.println(str);
        };

        five.f("123456");

        Five five2 = System.out::println;

        five2.f("abc");
    }

}
